current_dir = $(shell pwd)

COMMON_PATH=$(current_dir)/../common
ACL_PATH=$(current_dir)/../acl

C_INCLUDE_PATH=$(C_INCLUDE_PATH):/usr/local/include
LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):/usr/local/lib

CFLAGS?=	-Wall -ggdb -W -O
LDFLAGS?=

CC?=		gcc
LDLIBS?= -lpfring -lpcap -lpthread
INCLUDE = -I ../common   -I ../acl

COMMON_OBJ= $(COMMON_PATH)/common.o $(COMMON_PATH)/change.o
ACL_OBJ=$(ACL_PATH)/acl.o

TEMPFILES?=
 
src = $(wildcard *.c)        
objs = $(patsubst %.c,%.o,$(src))
 
VERSION=1.0
TMPDIR=/tmp/socket-$(VERSION)


SOURCES = $(wildcard *.c)
OBJS = $(patsubst %.c,%.o,$(SOURCES))


PF_RING=  pfring_ping pfring_read pfring_send pfring_tcpdump pfring_traceroute

all:	$(PF_RING) 

pfring_ping:pfring_ping.o $(COMMON_OBJ)

pfring_send:pfring_send.o $(COMMON_OBJ)

pfring_tcpdump:pfring_tcpdump.o $(COMMON_OBJ) $(ACL_OBJ)

pfring_traceroute:pfring_traceroute.o $(COMMON_OBJ)


%.o:%.c 
	$(CC) $(CFLAGS) $(LDFLAGS) -c $< -o $@   $(LDLIBS) $(INCLUDE)

clean:
	rm -f $(PF_RING)  $(TEMPFILES) *.o 

.PHONY: clean install all tar


 
